    #include<iostream>
    #include<vector>
    using namespace std;
    class Solution {
    public:
        vector<int> closestPrimes(int left, int right) {
            vector<bool>str(right+10);
            vector<int>prime;
            for(int i=2;i<=right;i++)
            {
                if(!str[i])prime.push_back(i);
                for(int j=0;prime[j]<=right/i;j++)
                {
                    str[i*prime[j]]=true;
                    if(i%prime[j]==0)break;
                }
            }
            int num=INT_MAX;
            vector<int>ans;
            for(int i=0,j=1;j<prime.size();i++,j++)
            {
                if(prime[i]<left)continue;
                int sum2=prime[j]-prime[i];
                if(num>sum2)
                {
                    num=sum2;
                    ans={prime[i],prime[j]};
                }
            }
            if(ans.size()<2)return {-1,-1};
            return ans;


        }
    };